#include <bits/stdc++.h>
using namespace std;
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
using ll = long long;
void solve()
{
    string s[3];
    cin >> s[1] >> s[2];

    int ans = 0;
    int last_zt = 0;
    int ls = -1;
    for (int i = 0; i < s[1].size(); i++)
    {
        if (s[1][i] == '.' && s[2][i] == '.')
            continue;
        if (ls != -1)
            ans += (i - ls - 1);
        if (s[1][i] == '#' && s[2][i] == '.')
        {
            if (last_zt == 2)
            {
                ans += 1;
                last_zt = 3;
            }
            else
            {
                last_zt = 1;
            }
        }
        else if (s[1][i] == '.' && s[2][i] == '#')
        {
            if (last_zt == 1)
            {
                ans += 1;
                last_zt = 3;
            }
            else
            {
                last_zt = 2;
            }
        }
        else
        {
            last_zt = 3;
        }
        ls = i;
    }
    cout << ans;
}
int main()
{
    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
